package com.itly.rwzq.controller;

import com.itly.rwzq.pojo.*;
import com.itly.rwzq.service.VisualizationService;
import com.itly.rwzq.utils.bubbleSort;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: 罗言
 * @Version: 1.0
 * @Date: 2024-01-18-1:05
 * @Description:
 */
@Controller
@RequestMapping("/vis")
@SuppressWarnings("all")
public class VisualizationController {

    @Autowired
    private VisualizationService service;

    @GetMapping("/data1")
    @ResponseBody
    public Result getData1() {
        List<paramData> data = service.getData1();
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data2")
    @ResponseBody
    public Result getData2() {
        List<paramData> param = service.getData2();
        List<paramData> data = bubbleSort.sort(param);
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data3")
    @ResponseBody
    public Result getData3() {
        List<paramData> param = service.getData3();
        List<paramData> data = bubbleSort.sort(param);
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data4")
    @ResponseBody
    public Result getData4() {
        List<paramData> param = service.getData4();
        List<paramData> data = bubbleSort.sort(param);
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data5")
    @ResponseBody
    public Result getData5() {
        List<paramData> param = service.getData5();
        List<paramData> data = bubbleSort.sort(param);
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data6")
    @ResponseBody
    public Result getData6() {
        List<paramData> param = service.getData6();
        List<paramData> data = bubbleSort.sort(param);
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data7")
    @ResponseBody
    public Result getData7() {
        List<paramData> param = service.getData7();
        List<paramData> data = bubbleSort.sort(param);
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data8")
    @ResponseBody
    public Result getData8() {
        List<paramData> param = service.getData8();
        List<paramData> data = bubbleSort.sort(param);
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data9")
    @ResponseBody
    public Result getData9() {
        List<paramData> data = service.getData9();
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data10")
    @ResponseBody
    public Result getData10() {
        List<paramData> data = service.getData10();
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data11")
    @ResponseBody
    public Result getData11() {
        List<paramData> data = service.getData11();
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data12")
    @ResponseBody
    public Result getData12() {
        List<paramData> data = service.getData12();
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data13")
    @ResponseBody
    public Result getData13() {
        List<paramData> data = service.getData13();
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data14")
    @ResponseBody
    public Result getData14() {
        List<paramData> data = service.getData14();
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data15")
    @ResponseBody
    public Result getData15() {
        List<paramData> data = service.getData15();
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data16")
    @ResponseBody
    public Result getData16() {
        List<paramData> data = service.getData16();
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data17")
    @ResponseBody
    public Result getData17() {
        List<paramData> data = service.getData17();
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data18")
    @ResponseBody
    public Result getData18() {
        List<paramData> data = service.getData18();
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data19")
    @ResponseBody
    public Result getData19() {
        List<paramData> data = service.getData19();
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data20")
    @ResponseBody
    public Result getData20() {
        List<paramData> data = service.getData20();
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data21")
    @ResponseBody
    public Result getData21() {
        List<paramData> data = service.getData21();
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data22")
    @ResponseBody
    public Result getData22() {
        List<paramData> data = service.getData22();
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data23")
    @ResponseBody
    public Result getData23() {
        List<paramData> data = service.getData23();
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data24")
    @ResponseBody
    public Result getData24() {
        List<paramData> data = service.getData24();
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data25")
    @ResponseBody
    public Result getData25() {
        List<paramData> data = service.getData25();
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data26")
    @ResponseBody
    public Result getData26() {
        List<paramData> param = service.getData26();
        List<paramData> data = bubbleSort.sort(param);
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data27")
    @ResponseBody
    public Result getData27() {
        List<paramData> param = service.getData27();
        List<paramData> data = bubbleSort.sort(param);
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data28")
    @ResponseBody
    public Result getData28() {
        List<paramData> param = service.getData28();
        List<paramData> data = bubbleSort.sort(param);
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data29")
    @ResponseBody
    public Result getData29() {
        List<paramData> param = service.getData29();
        List<paramData> data = bubbleSort.sort(param);
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data30")
    @ResponseBody
    public Result getData30() {
        List<paramData> param = service.getData30();
        List<paramData> data = bubbleSort.sort(param);
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data31")
    @ResponseBody
    public Result getData31() {
        List<paramData> param = service.getData31();
        List<paramData> data = bubbleSort.sort(param);
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data32")
    @ResponseBody
    public Result getData32() {
        List<paramData> param = service.getData32();
        List<paramData> data = bubbleSort.sort(param);
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data33")
    @ResponseBody
    public Result getData33() {
        List<paramData> data = service.getData33();
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data34")
    @ResponseBody
    public Result getData34() {
        List<paramData> data = service.getData34();
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data35")
    @ResponseBody
    public Result getData35() {
        List<paramData> data = service.getData35();
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data36")
    @ResponseBody
    public Result getData36() {
        List<paramData> data = service.getData36();
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data37")
    @ResponseBody
    public Result getData37() {
        List<paramData> data = service.getData37();
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data38")
    @ResponseBody
    public Result getData38() {
        List<paramData> data = service.getData38();
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data39")
    @ResponseBody
    public Result getData39() {
        List<paramData> data = service.getData39();
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data40")
    @ResponseBody
    public Result getData40() {
        List<paramData> data = service.getData40();
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data41")
    @ResponseBody
    public Result getData41() {
        List<paramData> data = service.getData41();
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data42")
    @ResponseBody
    public Result getData42() {
        List<paramData> data = service.getData42();
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data43")
    @ResponseBody
    public Result getData43() {
        List<paramData> data = service.getData43();
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data44")
    @ResponseBody
    public Result getData44() {
        List<paramData> data = service.getData44();
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

    @GetMapping("/data45")
    @ResponseBody
    public Result getData45() {
        Integer data = service.getData45();
        return new Result(data >= 0 ? Code.GET_OK : Code.GET_ERR, data);
    }

    @PostMapping("/data46")
    @ResponseBody
    public Result getData46(@RequestBody pageData pageData) {
        List<PageParam> data = service.getData46(pageData);
        return new Result(data != null ? Code.GET_OK : Code.GET_ERR, data);
    }

}
